﻿///////////////////////////////////////////////////////////////////////////
//  Copyright(c) 2023, GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007
//
/// @file    sdl_window.h
/// @brief   SDL2底层窗口
/// @version 0.1
/// @history 修改历史
/// @warning 没有警告
///////////////////////////////////////////////////////////////////////////
#ifndef __SDL_WINDOW_H__
#define __SDL_WINDOW_H__


#include "klb_type.h"
#include "SDL.h"
#include "core/render.h"
#include "render/wsdl_images.h"


#if defined(__cplusplus)
extern "C" {
#endif


typedef struct sdl_window_t_
{
    // SDL对象
    struct
    {
        SDL_Window*     p_window;       ///< 窗口
        SDL_Renderer*   p_render;       ///< 渲染器
    };

    render_t            r;
}sdl_window_t;


/// @brief 创建一个窗口
/// @return sdl_window_t* 窗口
sdl_window_t* sdl_window_create(int w, int h, const char* p_title);


/// @brief 销毁窗口
/// @param [in] *p_wnd          窗口
/// @return 无
void sdl_window_destroy(sdl_window_t* p_wnd);


void sdl_window_present(sdl_window_t* p_wnd);




#ifdef __cplusplus
}
#endif


#endif // __SDL_WINDOW_H__
//end
